package com.yehangtech.designpattern.行为型_命令模式.service;

import java.util.ArrayList;
import java.util.List;

public class XiaoEr {
    private List<ICaiPin> caiPinList = new ArrayList<>();

    public void dianCai(ICaiPin caiPin) {
        caiPinList.add(caiPin);
    }

    public void ShangCai() {
        caiPinList.forEach(ICaiPin::zuoCai);
    }
}
